﻿<UserControl x:Class="WidgetsModule.WeatherWidget.WeatherWidgetView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White" Margin="0,0,0,20"  HorizontalAlignment="Center" VerticalAlignment="Center">
        <StackPanel Orientation="Vertical">
            <TextBlock Text="Widgets Module" FontSize="10" HorizontalAlignment="Center"></TextBlock>
            <TextBlock Text="WeatherWidget View" FontSize="10" HorizontalAlignment="Center"></TextBlock>
            <Grid Visibility="{Binding WeHaveParameters}" Margin="0,5,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>
                </Grid.RowDefinitions>
                <TextBlock Text="Parameters passed to view:" HorizontalAlignment="Center" Grid.Row="0" />

                <ListBox Grid.Row="1" ItemsSource="{Binding Parameters}">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Key, StringFormat='\{0}\ =>'}" MinWidth="100"  />
                                <TextBlock Text="{Binding Value}" />
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </Grid>
        </StackPanel>
    </Grid>
</UserControl>
